package edu.hawaii.ics314.ical.model;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.text.ParseException;


/**
 * Provides support for serialization and deserialization.
 * 
 * @author 
 *
 */
public interface StringSerializable {
	
	/**
	 * Deserializes this object's fields from the specified <code>BufferedReader</code>.
	 * 
	 * @param in - the <code>BufferedReader</code> from which to deserialize this object's fields.
	 * @throws IOException if an error occurs while reading from the specified <code>BufferedReader</code>.
	 * @throws ParseException if the parsed input text is malformed.
	 * @throws NullPointerException if <code>in</code> is <code>null</code>.
	 */
	void readObject(BufferedReader in) throws IOException, ParseException;
	
	/**
	 * Serializes this object's fields from the specified <code>BufferedWriter</code>.
	 * 
	 * @param out - the <code>BufferedWriter</code> to which to serialize this object's fields.
	 * @throws IOException if an error occurs while writing to the specified <code>BufferedWriter</code>.
	 * @throws NullPointerException if <code>out</code> is <code>null</code>.
	 */
	void writeObject(BufferedWriter out) throws IOException;
	
}
